package com.itheima.a08regexdemo;

public class RegexDemo5 {
    public static void main(String[] args) {
        //身份证号码的简单校验
        //18位，前十七位为任意数字，最后一位可以是任意数字或X
        String regex = "[1-9]\\d{16}(\\d|X|x)";
        //校验
        System.out.println("44030519900101001X".matches(regex));//true
        System.out.println("44030519900101001x".matches(regex));//true
        System.out.println("440305199001010010".matches(regex));//true
    }
}
